<template>
  <div class="elm-edit pfull" style="overflow: hidden;">
    <elm-page-tb>
      <template #top>
        <el-date-picker v-model="postData.now_year" type="year" value-format="yyyy" placeholder="选择年份" size="mini" style="width: 250px;" clearable></el-date-picker>
        <right>
          <el-button-group>
            <el-button icon="el-icon-search" size="mini" @click="tablebinding()">查询</el-button>
          </el-button-group>
        </right>
      </template>
      <elm-table url="/business/analysis/cockpit/GetWjsList" :post-data="postData" :show-index="true">
        <el-table-column prop="name" label="名称" align="left" header-align="center"></el-table-column>
        <el-table-column prop="ltype" label="类别" align="center" width="120"></el-table-column>
        <el-table-column prop="total_amount" label="金额（万元）" :formatter="formatAmount" align="left" width="120" header-align="center"></el-table-column>
        <el-table-column prop="ldate" label="时间" align="center" :formatter="formatDate" width="180"></el-table-column>
      </elm-table>
    </elm-page-tb>
  </div>
</template>

<script>
export default {
  extends: elmVueBase,
  data() {
    return {
      postData: {
        now_year: elm.parseTime(new Date(), '{y}'),
      },
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    formatAmount(row, column, value) {
      console.log(value)
      if (value) {
        return parseFloat(value).toFixed(2).replace(/\.0+$/, '').replace(/(\.\d)0+$/, '$1');
      }
      return '';
    }
  }
}
</script>

<style scoped>
</style>